const connection = require("../app/database");

class LabelService {
  async create(name) {
    const statement = "INSERT INTO `label` (name) VALUES (?)";
    const [result] = await connection.execute(statement, [name]);
    return result;
  }
  async queryList(offset, size) {
    console.log(offset, size);
    const statement = "SELECT * FROM  label LIMIT ? OFFSET ?";
    const [result] = await connection.execute(statement, [String(size), String(offset)]);
    console.log(result);
    return result;
  }

  async queryLableByName(name){
        
  }

}

module.exports = new LabelService();
